
//节点数据
export const nodes = [{
		data: {
			id: 'DS_TK_TS_00_65d7935a097c4b91b9c455e6129dfd5f',
			name: 'test_step_1019',
			textColor: 'red',
			typeClass:'微服务调用'
		},
		renderedPosition: { 'x': '230', 'y': '230' },
	},
	{
		data: {
			id: 'DS_TK_DS_00_db766d93a9644601a7c0af05aac07310',
			name: 'test_step_1019_03',
			typeClass:'JAVA程序'
		},
		renderedPosition: { 'x': '480', 'y': '290' }
	},
	{
		data: {
			id: 'DS_TK_SQ_00_7a1188ce306e47f2bc03ce9960be75d1',
			name: 'test_step_1019_02',
			'x': '277',
			'y': '340',
			typeClass:'IPLAT数据同步'
		},
		renderedPosition: {
			'x': '277',
			'y': '340',
			
		}
	},
	{
		data: {
			id: 'start',
			name: 'START',
			'x': '160',
			'y': '107',
			
		},
		renderedPosition: { 'x': '160', 'y': '107' }
	},
{
		data: {
			id: 'finish',
			name: 'FINISH',
			
		},
		renderedPosition: { 'x': '480', 'y': '124' }
	},
]

//连线数据
export const edges = [{
		data: {
			source: 'start',
			target: 'DS_TK_TS_00_65d7935a097c4b91b9c455e6129dfd5f'
		}
	},
	{
		data: {
			source: 'DS_TK_TS_00_65d7935a097c4b91b9c455e6129dfd5f',
			target: 'DS_TK_SQ_00_7a1188ce306e47f2bc03ce9960be75d1'
		}
	},
	{
		data: {
			source: 'DS_TK_TS_00_65d7935a097c4b91b9c455e6129dfd5f',
			target: 'DS_TK_DS_00_db766d93a9644601a7c0af05aac07310'
		}
	},
	{
		data: {
			source: 'DS_TK_TS_00_65d7935a097c4b91b9c455e6129dfd5f',
			target: 'finish',
			label: '',
			textColor:'#363fed'
		}
	},
	{
		data: {
			source: 'DS_TK_DS_00_db766d93a9644601a7c0af05aac07310',
			target: 'finish'
		}
	},
	{
		data: {
			source: 'DS_TK_SQ_00_7a1188ce306e47f2bc03ce9960be75d1',
			target: 'DS_TK_DS_00_db766d93a9644601a7c0af05aac07310'
		}
	},
	{
		data: {
			source: 'DS_TK_SQ_00_7a1188ce306e47f2bc03ce9960be75d1',
			target: 'finish'
		}
	},
]
export const NodeList = {"Nodes":[{"data":{"id":"DS_TK_TS_00_65d7935a097c4b91b9c455e6129dfd5f","name":"test_step_1019","title":"test_step_1019\n   _","type":"","height":56,"width":118.8271484375,"nodeType":"round-rectangle"},"renderedPosition":{"x":"660","y":"280"}},{"data":{"id":"DS_TK_DS_00_db766d93a9644601a7c0af05aac07310","name":"test_step_1019_032222222222","title":"test_step_1019...\n  _","type":"","height":56,"width":141.5224609375,"nodeType":"round-rectangle"},"renderedPosition":{"x":"1500","y":"590"}},{"data":{"id":"DS_TK_SQ_00_7a1188ce306e47f2bc03ce9960be75d1","name":"test_step_1019_02","title":"test_step_1019...\n  _","type":"","height":56,"width":141.5224609375,"nodeType":"round-rectangle"},"renderedPosition":{"x":"860","y":"800"}},{"data":{"id":"start","name":"START","title":"START","type":"","height":40,"width":80,"nodeType":"round-rectangle"},"renderedPosition":{"x":"160","y":"107"}},{"data":{"id":"finish","name":"FINISH","title":"FINISH","type":"","height":40,"width":80,"nodeType":"round-rectangle"},"renderedPosition":{"x":"1500","y":"141"}}],"Edges":[{"data":{"source":"start","target":"DS_TK_TS_00_65d7935a097c4b91b9c455e6129dfd5f","id":"a4165807-cdca-410e-ac2f-51097b71a698"}},{"data":{"source":"DS_TK_TS_00_65d7935a097c4b91b9c455e6129dfd5f","target":"DS_TK_SQ_00_7a1188ce306e47f2bc03ce9960be75d1","id":"ec4b345b-1135-430c-8c01-0a2a89e7ce3e"}},{"data":{"source":"DS_TK_TS_00_65d7935a097c4b91b9c455e6129dfd5f","target":"DS_TK_DS_00_db766d93a9644601a7c0af05aac07310","id":"9e76ea1a-ecbb-4b01-83d0-6acbd142e21f"}},{"data":{"source":"DS_TK_TS_00_65d7935a097c4b91b9c455e6129dfd5f","target":"finish","id":"1e50229f-42a6-4caf-95fd-810591544af6"}},{"data":{"source":"DS_TK_DS_00_db766d93a9644601a7c0af05aac07310","target":"finish","id":"9358cdea-e6b3-442d-9fbc-44bb9172c88a"}},{"data":{"source":"DS_TK_SQ_00_7a1188ce306e47f2bc03ce9960be75d1","target":"DS_TK_DS_00_db766d93a9644601a7c0af05aac07310","id":"69e1c576-0dbb-4e4d-a946-e6eac3948e74"}},{"data":{"source":"DS_TK_SQ_00_7a1188ce306e47f2bc03ce9960be75d1","target":"finish","id":"c2c75865-d4d7-4806-ada7-e177bed70d59"}}]}




export const cytoscapeLayout = {
    name: 'preset', //该random布局使节点在视口内随机位置。
    fit: true, //如果要适应视区
    padding: 15, //安装padding
    animate: false, //如果要转换节点位置
    animationDuration: 500,
    minNodeSpacing: 180, //控制大小
    maxNodeSpacing: 220, //控制大小
    transform: (node, position) => {
        /* console.log("transform node",node);
            console.log("transform position",position);
            if(node.id() == "start"){
                position= {x:0,y:0}
            } */
        return position;
    }
};

export const cytoscapeStyle = [
    {
        //样式
        selector: 'node', //节点样式
        style: {
            shape: 'data(nodeType)', //形状
            content: 'data(title)', //显示内容
            'text-valign': 'center', //文字位置
            'text-halign': 'center',
            "text-wrap": "wrap",
            "text-max-width": "120",
            'text-overflow-wrap': '\n',
            "text-justification": "center",
            "font-family":"Consolas,'Courier New',Courier,monospace,sans-serif",
            color:"#FFFFFF",
            "line-height": "1.6",//行间距倍数
            "word-wrap": "break-word",
            "word-break": "normal",
            'background-color': '#4B4B4B',
            'border-color': 'gray',
            'border-width': 1,
            "font-size": '14',
            'background-fit': 'cover',
            'text-opacity': 0.8,
            height: "data(height)",
            width: "data(width)",
            'pie-size': '100%',
            'active-bg-color': 'red',
            'selection-box-color': 'blue'
        }
    },
    // {
    //     selector: ':parent', //组合
    //     css: {
    //         "word-wrap": "break-word",
    //         "word-break": "normal",
    //         'text-valign': 'center',
    //         'text-halign': 'center'
    //     }
    // },
    // {
    //     selector: '.selectNode', //选中样式
    //     css: {
    //         'border-color': '#666',
    //         'border-width': 2
    //     }
    // },
    {
        selector: '.w', //选中样式
        css: {
            'text-valign': 'center',
            'text-halign': 'center',
            "word-wrap": "break-word",
            "word-break": "normal",
        }
    },
    {
        selector: 'edge', //连线样式
        style: {
            width: 2,
            'curve-style': 'bezier',
            'target-arrow-shape': 'triangle',
            color: '#363fed',
            cursor: 'pointer',
            'line-color': '#4B4B4B',
            'target-arrow-color': '#4B4B4B',

        }
    }
];

export const cytoscapeBaseInfo = {
    zoom: 1, // 图表的初始缩放级别.可以设置options.minZoom和options.maxZoom设置缩放级别的限制.
    minZoom: 0.3, // 图表缩放级别的最小界限.视口的缩放比例不能小于此缩放级别.
    maxZoom: 1.5, // 图表缩放级别的最大界限.视口的缩放比例不能大于此缩放级别.
    zoomingEnabled: true, // 是否通过用户事件和编程方式启用缩放图形.
    userZoomingEnabled: true, // 是否允许用户事件(例如鼠标滚轮,捏合缩放)缩放图形.对此缩放的编程更改不受此选项的影响.
    autoungrabify: false, // 默认情况下节点是否不允许被拾取(用户不可抓取,如果true覆盖单个节点状态).
    panningEnabled: false, // 是否通过用户事件和编程方式启用平移图形,画布平移功能.
    userPanningEnabled: true, // 是否允许用户事件(例如拖动图形背景)平移图形.平移的程序化更改不受此选项的影响.
    boxSelectionEnabled: false, // 是否启用了框选择(即拖动框叠加,并将其释放为选择).如果启用,则用户必须点击以平移图表.
    selectionType: 'additive', // 一个字符串，指示用户输入的选择行为.对于'additive',用户进行的新选择将添加到当前所选元素的集合中.对于'single',用户做出的新选择成为当前所选元素的整个集合.
    touchTapThreshold: 8, // 非负整数,分别表示用户在轻击手势期间可以在触摸设备和桌面设备上移动的最大允许距离.这使得用户更容易点击.
    // // 这些值具有合理的默认值,因此建议不要更改这些选项,除非您有充分的理由这样做.大值几乎肯定会产生不良后果。
    desktopTapThreshold: 4, // 非负整数,分别表示用户在轻击手势期间可以在触摸设备和桌面设备上移动的最大允许距离.这使得用户更容易点击.
    // 这些值具有合理的默认值,因此建议不要更改这些选项,除非您有充分的理由这样做.大值几乎肯定会产生不良后果。
    autolock: true, // 默认情况下是否应锁定节点(根本不可拖动,如果true覆盖单个节点状态).
    autounselectify: false, // 默认情况下节点是否允许被选择(不可变选择状态,如果true覆盖单个元素状态).
    headless: false, // true:空运行,不显示不需要容器容纳.false:显示需要容器容纳.
    styleEnabled: true, // 一个布尔值,指示是否应用样式.
    hideEdgesOnViewport: true, // 渲染提示,设置为true在渲染窗口时,不渲染边.例如,移动某个顶点时或缩放时,边信息会被临时隐藏,移动结束后,边信息会被执行一次渲染.由于性能增强,此选项现在基本上没有实际意义.
    hideLabelsOnViewport: false, // 渲染提示,当设置为true使渲染器在平移和缩放期间使用纹理而不是绘制元素时,使大图更具响应性.由于性能增强,此选项现在基本上没有实际意义.
    textureOnViewport: false, // 渲染提示,当设置为true使渲染器在平移和缩放期间使用纹理而不是绘制元素时,使大图更具响应性.由于性能增强,此选项现在基本上没有实际意义.
    motionBlur: false, // 渲染提示,设置为true使渲染器使用运动模糊效果使帧之间的过渡看起来更平滑.这可以增加大图的感知性能.由于性能增强,此选项现在基本上没有实际意义.
    motionBlurOpacity: 1, // 当motionBlur:true,此值控制运动模糊帧的不透明度.值越高,运动模糊效果越明显.由于性能增强,此选项现在基本上没有实际意义.
    wheelSensitivity: 0.5, // 缩放时更改滚轮灵敏度.这是一个乘法修饰符.因此,0到1之间的值会降低灵敏度(变焦较慢),而大于1的值会增加灵敏度(变焦更快).
    pixelRatio: 'auto', // 使用手动设置值覆盖屏幕像素比率(1.0建议,如果已设置).这可以通过减少需要渲染的有效区域来提高高密度显示器的性能,

}


 export const stepTypeList = [{"finishTime":"2022-01-04 19:15:16","stepType":"7","timeConsuming":"3","detailedStatus":"FAILURE","submitTime":"2022-01-04 19:15:12","stepName":"test_step_1019","commitTime":"2022-01-04 19:15:13","stepInstanceId":"test_step_1019:384514:1641294912","projectName":"YXH_TEST_02","stepStatus":"FAILED"}]